<admintpl file="header" />
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:U('Project/index')}">项目管理</a></li>
        <li class="active"><a href="{:U('Project/add',array('id'=>empty($item['id'])?'':$item['id']))}" target="_self">新增</a></li>
    </ul>
    <form action="{:U('Project/add_post')}" method="post" class="form-horizontal js-ajax-forms" enctype="multipart/form-data" onsubmit="return checkform();">
        <div class="row-fluid">
            <div class="span9">
                <table class="table table-bordered">
                    <tr>
                        <th>选择分类 <span class="form-required">*</span></th>
                        <td>
                            <select name="tid" id="tid">
                                <foreach name="project_type" key="tkey" item="titem">
                                    <option value="{$tkey}" <if condition="$item['tid'] == $tkey">selected</if> >{$titem}</option>
                                </foreach>
                            </select>
                        </td>
                    </tr>

                    <tr>
                        <th>标题 <span class="form-required">*</span></th>
                        <td>
                            <input type="text" name="title" class="require" id="title" value="{$item.title}" style="width: 400px" placeholder="请输入标题">
                        </td>
                    </tr>

                    <tr>
                        <th><b>图片 <span class="form-required">*</span></b></th>

                        <td>
                            <input type="hidden" class="require" name="picture" id="picture" value="{$item.picture}">
                            <div style="text-align: left;">

                                <a href="javascript:upload_one_image('图片上传','#picture');">
                                    <if condition="empty($item['picture'])">
                                        <img src="__TMPL__Public/assets/images/default-thumbnail.png" id="picture-preview" width="135" style="cursor: hand"/>
                                        <else />
                                        <img src="{:sp_get_image_preview_url($item['picture'])}" id="picture-preview" width="135" style="cursor: hand"/>
                                    </if>
                                </a>
                                <input type="button" class="btn btn-small" onclick="$('#picture-previeww').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#picture').val('');return false;" value="取消图片">
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <th>项目大小 </th>
                        <td>
                            <input type="text" name="project_size" class="" id="project_size" value="{$item.project_size}" style="width: 400px" placeholder="请输入项目大小">
                        </td>
                    </tr>

                    <tr>
                        <th>系统类型 </th>
                        <td>
                            <input type="text" name="project_type" class="" id="project_type" value="{$item.project_type}" style="width: 400px" placeholder="请输入系统类型">
                        </td>
                    </tr>

                    <tr>
                        <th>项目承建方 </th>
                        <td>
                            <input type="text" name="project_contractor" class="" id="project_contractor" value="{$item.project_contractor}" style="width: 400px" placeholder="请输入项目承建方">
                        </td>
                    </tr>

                    <tr>
                        <th>预计每年发电量 </th>
                        <td>
                            <input type="text" name="capacity" class="" id="capacity" value="{$item.capacity}" style="width: 400px" placeholder="请输入预计每年发电量">
                        </td>
                    </tr>

                    <tr>
                        <th>投资人 </th>
                        <td>
                            <input type="text" name="investor" class="" id="investor" value="{$item.investor}" style="width: 400px" placeholder="请输入投资人">
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="form-actions">
            <input type="hidden" name="id" value="{$item.id}"/>
            <button class="btn btn-primary js-ajax-submit" type="submit">提交</button>
            <a class="btn" href="{:U('Project/index')}">返回</a>
        </div>
    </form>
</div>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
</body>
</html>